<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload = function(){
            var oDiv = document.getElementById("div1")
            var oDiv2 = document.getElementById("oDiv2")

            alert(oDiv.innerHTML)
            oDiv.innerHTML = "<h1>hello world</h1>"//<h1>标签会被解析


            oDiv2.innerText = "<h1>hello world</h1>"
        }
    </script>
</head>
<body>
    <div id = "div1">
        <em>我去</em>
        <strong>ottttto</strong>
    </div>
    <div id = "oDiv2"></div>
</body>
</html>